// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

import Router from 'vue-router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './plugins/element'
import axios from 'axios'
/** 导入全局样式表*/
import './assets/css/global.css'
//导入字体图标
import './assets/fonts/iconfont.css'

//配置请求的根路径
axios.defaults.baseURL = 'http://timemeetyou.com:8889/api/private/v1/'
//拦截器
axios.interceptors.request.use(config=>{
  console.log(config);
  //为拦截器添加头部信息
  config.headers.Authorization =window.sessionStorage.getItem('token');
  //在最后必须return config
  return config
})
Vue.prototype.$http = axios
Vue.use(ElementUI);
Vue.use(Router);
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: {
    App
  },
  template: '<App/>'
})
